package com.example.mytayunapi.Mapper;

import com.example.mytayunapi.Entity.ProductImagesInfo;
import com.example.mytayunapi.Entity.productsInfo;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ProductImagesInfoMapper {

    @Select("SELECT * FROM productimages WHERE Product_id = #{productId}")
    List<ProductImagesInfo> getProductImagesById(Integer productId);

    @Results(id = "productImagesInfoResultMap", value = {
            @Result(property = "Product_id", column = "product_id"),
            @Result(property = "Product_image", column = "product_image")
            // 其他属性映射
    })
    @Insert("INSERT INTO productimages (Product_image, Product_id) VALUES (#{Product_image}, #{Product_id})")
    void insertProductImagesInfo(ProductImagesInfo productImagesInfo);
}



